package com.gogowan.agroenterprise.utils;

import java.util.Comparator;

import com.gogowan.agroenterprise.model.StoreModel;

/**
 * 拼音排序规则
 * 
 * @author tjh 2017-01-04
 *
 */
public class PinyinComparator implements Comparator<StoreModel> {

	@Override
	public int compare(StoreModel o1, StoreModel o2) {
		if (o1.getEnglishName().substring(0, 1).equals("@")
				|| o2.getEnglishName().substring(0, 1).equals("#")) {
			return -1;
		} else if (o1.getEnglishName().substring(0, 1).equals("#")
				|| o2.getEnglishName().substring(0, 1).equals("@")) {
			return 1;
		} else {
			return o1.getEnglishName().substring(0, 1)
					.compareTo(o2.getEnglishName().substring(0, 1));
		}
	}

}
